---
import katex from "katex";

interface Props {
  formula: string;
  inline?: boolean;
}

const { formula = "", inline } = Astro.props;
const html = katex.renderToString(formula, { throwOnError: false });
---

{
  inline ? (
    <span set:html={html} />
  ) : (
    <div class="text-center">
      <span set:html={html} />
    </div>
  )
}
